package com.aqumon.www.entity.request.data;
import lombok.Data;

import java.util.Locale;


/**
 * 测试账号 筛选与查询
 *
 * @author xhf
 * @date 2022/6/16
 */
@Data
public class RaaSAccQueryReq {
    private Long id;

    private Integer flagUsage;

    private String project;

    private String holdings;

    private Integer pageNum;

    private Integer pageSize;

    public RaaSAccQueryReq(String flagUsage, String project, String holdings, Integer pageNum, Integer pageSize) {
        if (flagUsage == null || flagUsage.isEmpty()) {
            this.flagUsage = null;
        } else if (flagUsage.toLowerCase().contains("yes") || flagUsage.toLowerCase().contains("已使用")) {
            this.flagUsage = 1;
        } else if (flagUsage.toLowerCase().contains("未使用") || flagUsage.toLowerCase().contains("no")) {
            this.flagUsage = 0;
        } else {
            this.flagUsage = null;
        }
        if (project == null || project.isEmpty()) {
            this.project = null;
        } else if (project.toLowerCase().contains("all") || project.toLowerCase().contains("全部")) {
            this.project = null;
        } else {
            this.project = project;
        }if (holdings == null || holdings.isEmpty()) {
            this.holdings = "";
        } else if (holdings.toLowerCase().contains("all") || holdings.toLowerCase().contains("全部")) {
            this.holdings = "";
        } else {
            this.holdings = holdings;
        }
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }
}
